﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace HSIA.SMS
{
    public partial class FormAddSms : Form
    {
        public FormAddSms()
        {
            InitializeComponent();
        }

        private void FormAddSms_Load(object sender, EventArgs e)
        {

        }

        private void button1_Click(object sender, EventArgs e)
        {
            if (textBox1.Text.Trim().Length < 11)
            {
                MessageBox.Show("手机号码格式不正确！", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else this.DialogResult = System.Windows.Forms.DialogResult.OK;
        }

        private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (e.KeyChar != 8 && !Char.IsDigit(e.KeyChar))
            {
                e.Handled = true;
            }
        }

        public string[] GetData()
        {
            return new string[] { textBox1.Text.Trim(), textBox2.Text.Trim() };
        }
    }
}
